package com.jerome.election.sync;

import java.io.IOException;
import java.net.Socket;

/**
 * Service Center Service
 * @author Jerome
 * @date 2023/9/12
 */
public interface SyncClientHandler {
    /**
     * init logic
     * @param socket
     * @author Jerome
     * @date 2023/10/19 16:12
     */
    void initHandle(Socket socket) throws IOException;
    /**
     * Receiving processor
     * @param socket
     * @throws IOException
     * @throws ClassNotFoundException
     */
    void receiveHandle(Socket socket) throws IOException;

    /**
     * Heartbeat processor
     *
     * @param socket
     * @throws IOException
     * @throws ClassNotFoundException
     */
    void heartbeatHandle(Socket socket) throws IOException, ClassNotFoundException;

    /**
     * Sending processor
     *
     * @param socket
     * @param syncVo
     * @throws IOException
     * @throws ClassNotFoundException
     */
    void sendHandle(Socket socket, SyncVo syncVo) throws IOException;
}

